package com.firefly.admin.monitor.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.firefly.admin.common.vo.Result;
import com.firefly.admin.monitor.entity.FyMonitorLoginLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.firefly.admin.monitor.service.FyMonitorLoginLogService;
import com.firefly.admin.monitor.vo.MonitorLoginLogQueryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "系统登录日志接口API")
@RestController
@RequestMapping("/monitor/login/log")
public class FyMonitorLoginLogController {
    @Autowired
    private FyMonitorLoginLogService fyMonitorLoginLogService;

    /**
     * 分页查询登录日志接口
     *
     * @param monitorLoginLogQueryVo 分页查询参数
     * @return 分页列表
     */
    @ApiOperation(value = "分页查询登录日志接口", notes = "分页查询登录日志接口", httpMethod = "GET")
    @PreAuthorize(value = "hasAuthority('monitor:login:log')")
    @GetMapping("/list")
    public Result<Page<FyMonitorLoginLog>> getMonitorLoginLogList(MonitorLoginLogQueryVo monitorLoginLogQueryVo) {
        return fyMonitorLoginLogService.getMonitorLoginLogList(monitorLoginLogQueryVo);
    }
}
